package com.imti.retrofitdemo;

import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class MainActivity extends AppCompatActivity// implements IWeatherPresenter
{

    private static final String TAG = MainActivity.class.getSimpleName();

    private WeatherPresenter weatherLogic;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        weatherLogic = new WeatherPresenter();

        weatherLogic.requestCityList("74c07874db669773835f6bcb449b1776",
            new IWeatherPresenter()
            {
                @Override
                public void onCityListSuccess(List<CityModel> cityList)
                {
                    for (int i = 0; i < cityList.size(); i++)
                    {
                        Log.d(TAG, cityList.get(i).getCity());
                        Log.d(TAG, cityList.get(i).getId());

                    }
                }
            });
    }


}